Function Import-SourceControlDefinition
{
        [cmdletbinding(DefaultParameterSetName="none")]
        Param( 
        [Parameter(Mandatory=$true,ValueFromPipeline=$false)]
        [ValidateScript({Test-Path $_ -PathType Leaf})] 
        [String] 
        $SourceControlDefinitionPath
        )

    Begin
    {
        $watch = [system.diagnostics.stopwatch]::StartNew() 
        write-verbose "Start Load-SourceControlDefinition from '$SourceControlDefinitionPath'"
    }
    End
    {
        write-verbose "End Load-SourceControlDefinition from '$SourceControlDefinitionPath'"
        $watch.Stop();
        Write-Verbose "Function duration : $($watch.Elapsed)"
    }
    Process 
    {

        $templateRootNode = Select-Xml -Path $SourceControlDefinitionPath -XPath "/repositories"
        $templateRootNode.Node.SelectNodes("*") | ForEach-Object {        
            Assert-XmlAttribute -xmlElement $_ -xmlAttribute uniqueKey
            New-DynamicObject_v2 -Source $_
        }
    }
}
